﻿Imports System.Windows.Forms

Public Class Main
    Inherits Form

    Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ExitToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub RedoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles RedoToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmDvtHamLuong Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmDvtHamLuong.Show()
        DmDvtHamLuong.MdiParent = Me
        DmDvtHamLuong.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub UndoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UndoToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmChiNhanh Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmChiNhanh.Show()
        DmChiNhanh.MdiParent = Me
        DmChiNhanh.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub CutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CutToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmUyNhiemChi Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmUyNhiemChi.Show()
        DmUyNhiemChi.MdiParent = Me
        DmUyNhiemChi.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmQuocGia Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmQuocGia.Show()
        DmQuocGia.MdiParent = Me
        DmQuocGia.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub SelectAllToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectAllToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmLoaiKhachHang Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmLoaiKhachHang.Show()
        DmLoaiKhachHang.MdiParent = Me
        DmLoaiKhachHang.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmLoaiTaiKhoan Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmLoaiTaiKhoan.Show()
        DmLoaiTaiKhoan.MdiParent = Me
        DmLoaiTaiKhoan.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub LoạiTiềnToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoạiTiềnToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmLoaiTien Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmLoaiTien.Show()
        DmLoaiTien.MdiParent = Me
        DmLoaiTien.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub NgànhNghềToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NgànhNghềToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmNganhNghe Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmNganhNghe.Show()
        DmNganhNghe.MdiParent = Me
        DmNganhNghe.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub NhómVậtTưToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NhómVậtTưToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmNhomVatTu Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmNhomVatTu.Show()
        DmNhomVatTu.MdiParent = Me
        DmNhomVatTu.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub FileMenu_Click(sender As System.Object, e As System.EventArgs) Handles FileMenu.Click

    End Sub

    Private Sub ToolBarToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ToolBarToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is KeToanTienMat1 Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        KeToanTienMat1.Show()
        KeToanTienMat1.MdiParent = Me
        KeToanTienMat1.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Me.MenuTableAdapter.Fill(Me.ErpharmaDataSet.menu)
        Me.MenuitemTableAdapter.Fill(Me.ErpharmaDataSet.menuitem)
        Me.UltraTree1.ExpandAll()
    End Sub

    Private Sub StatusBarToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles StatusBarToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is KeToanNganHang1 Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        KeToanNganHang1.Show()
        KeToanNganHang1.MdiParent = Me
        KeToanNganHang1.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub KhoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles KhoToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmTheoDoiChinhSuaBaoBi Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmTheoDoiChinhSuaBaoBi.Show()
        DmTheoDoiChinhSuaBaoBi.MdiParent = Me
        DmTheoDoiChinhSuaBaoBi.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub LoạiHaoHụtToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles LoạiHaoHụtToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmLoaihaohut Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmLoaihaohut.Show()
        dmLoaihaohut.MdiParent = Me
        dmLoaihaohut.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub NguoonToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NguoonToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmTinhThanh Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmTinhThanh.Show()
        DmTinhThanh.MdiParent = Me
        DmTinhThanh.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub NguồnVốnToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NguồnVốnToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmNguonVon Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmNguonVon.Show()
        dmNguonVon.MdiParent = Me
        dmNguonVon.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub NhómNhânViênToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NhómNhânViênToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmNhomNhanVien Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmNhomNhanVien.Show()
        dmNhomNhanVien.MdiParent = Me
        dmNhomNhanVien.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub TàiKhoảnNgânHàngToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TàiKhoảnNgânHàngToolStripMenuItem.Click
        'Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        'If forms.Length > 0 Then 'nếu có form active
        '    For Each f As Form In forms 'duyệt tất cả form
        '        If TypeOf f Is DmTaiKhoanNganHang Then ' so sanh kieu khác với C#
        '            Me.ActivateMdiChild(f)
        '            f.WindowState = FormWindowState.Maximized
        '        End If
        '    Next
        'End If
        'DmTaiKhoanNganHang.Show()
        'DmTaiKhoanNganHang.MdiParent = Me
        'DmTaiKhoanNganHang.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem2_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem2.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmKhaiBaoSoHoaDon Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmKhaiBaoSoHoaDon.Show()
        dmKhaiBaoSoHoaDon.MdiParent = Me
        dmKhaiBaoSoHoaDon.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem3_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem3.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmKho Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmKho.Show()
        DmKho.MdiParent = Me
        DmKho.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem4_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem4.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmKheUocVay Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmKheUocVay.Show()
        DmKheUocVay.MdiParent = Me
        DmKheUocVay.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem5_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem5.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmMauIn Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmMauIn.Show()
        DmMauIn.MdiParent = Me
        DmMauIn.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem6_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem6.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmNghiepVu Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmNghiepVu.Show()
        DmNghiepVu.MdiParent = Me
        DmNghiepVu.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem7_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem7.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmNguonLuc Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmNguonLuc.Show()
        dmNguonLuc.MdiParent = Me
        dmNguonLuc.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem8_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem8.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmPhuongXa Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmPhuongXa.Show()
        DmPhuongXa.MdiParent = Me
        DmPhuongXa.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem9_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem9.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmQuanHuyen Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmQuanHuyen.Show()
        DmQuanHuyen.MdiParent = Me
        DmQuanHuyen.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem10_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem10.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmTyGia Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmTyGia.Show()
        DmTyGia.MdiParent = Me
        DmTyGia.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ỦyNhiệmChiToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ỦyNhiệmChiToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmUyNhiemChi Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmUyNhiemChi.Show()
        DmUyNhiemChi.MdiParent = Me
        DmUyNhiemChi.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub NhậpSốDưĐầuKỳNgânHàngToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NhậpSốDưĐầuKỳNgânHàngToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is Nhapsodudaukytknganhang Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        Nhapsodudaukytknganhang.Show()
        Nhapsodudaukytknganhang.MdiParent = Me
        Nhapsodudaukytknganhang.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub TheoDõiNguyênVậtLiệuToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TheoDõiNguyênVậtLiệuToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is theodoinguyenvatlieuncc Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        theodoinguyenvatlieuncc.Show()
        theodoinguyenvatlieuncc.MdiParent = Me
        theodoinguyenvatlieuncc.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub CopyToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CopyToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmPhongBan Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmPhongBan.Show()
        DmPhongBan.MdiParent = Me
        DmPhongBan.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem11.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmKhachHang Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmKhachHang.Show()
        DmKhachHang.MdiParent = Me
        DmKhachHang.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem12.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmKhoanMucPhi Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmKhoanMucPhi.Show()
        DmKhoanMucPhi.MdiParent = Me
        DmKhoanMucPhi.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem13.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmLoaiHangMuc Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmLoaiHangMuc.Show()
        dmLoaiHangMuc.MdiParent = Me
        dmLoaiHangMuc.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem14.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmNganHang Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmNganHang.Show()
        DmNganHang.MdiParent = Me
        DmNganHang.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem15.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is DmNhanVienBanHang Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        DmNhanVienBanHang.Show()
        DmNhanVienBanHang.MdiParent = Me
        DmNhanVienBanHang.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ContentsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ContentsToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is MuaHangTrongNuoc Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        MuaHangTrongNuoc.Show()
        MuaHangTrongNuoc.MdiParent = Me
        MuaHangTrongNuoc.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub IndexToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IndexToolStripMenuItem.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is MuaHangNhapKhau Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        MuaHangNhapKhau.Show()
        MuaHangNhapKhau.MdiParent = Me
        MuaHangNhapKhau.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub ToolStripMenuItem16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem16.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmvattu1 Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmvattu1.Show()
        dmvattu1.MdiParent = Me
        dmvattu1.WindowState = FormWindowState.Maximized
    End Sub

    Private Sub HàngHóaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HàngHóaToolStripMenuItem.Click

    End Sub

    Private Sub UltraTree1_AfterSelect(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinTree.SelectEventArgs) Handles UltraTree1.AfterSelect
        
    End Sub

    Private Sub UltraTree1_Click(sender As Object, e As System.EventArgs) Handles UltraTree1.Click
        If UltraTree1.ActiveNode.Cells("ma").Value = "KTTM" Then
            Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
            If forms.Length > 0 Then 'nếu có form active
                For Each f As Form In forms 'duyệt tất cả form
                    If TypeOf f Is KeToanTienMat1 Then ' so sanh kieu khác với C#
                        Me.ActivateMdiChild(f)
                        f.WindowState = FormWindowState.Maximized
                    End If
                Next
            End If
            KeToanTienMat1.Show()
            KeToanTienMat1.MdiParent = Me
            KeToanTienMat1.WindowState = FormWindowState.Maximized
            'Dim f As ProgressBar = New ProgressBar
            'Dim f As UltraActivityIndicator = New UltraActivityIndicator
            'f.Show()
        End If
        If UltraTree1.ActiveNode.Cells("ma").Value = "KTNH" Then
            Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
            If forms.Length > 0 Then 'nếu có form active
                For Each f As Form In forms 'duyệt tất cả form
                    If TypeOf f Is KeToanNganHang1 Then ' so sanh kieu khác với C#
                        Me.ActivateMdiChild(f)
                        f.WindowState = FormWindowState.Maximized
                    End If
                Next
            End If
            KeToanNganHang1.Show()
            KeToanNganHang1.MdiParent = Me
            KeToanNganHang1.WindowState = FormWindowState.Maximized
        End If
    End Sub

    Private Sub ToolStripMenuItem17_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripMenuItem17.Click
        Dim forms() As Form = Me.MdiChildren ' lay ve cac mdi child form tren parent form
        If forms.Length > 0 Then 'nếu có form active
            For Each f As Form In forms 'duyệt tất cả form
                If TypeOf f Is dmTaiKhoanCap2 Then ' so sanh kieu khác với C#
                    Me.ActivateMdiChild(f)
                    f.WindowState = FormWindowState.Maximized
                End If
            Next
        End If
        dmTaiKhoanCap2.Show()
        dmTaiKhoanCap2.MdiParent = Me
        dmTaiKhoanCap2.WindowState = FormWindowState.Maximized
    End Sub
End Class
